@import "../../base.less";

@import "./_var.less";

@import "../../mixins/_index.less";

.@{prefix}-toast {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  max-width: 188px;
  border-radius: @border-radius;
  color: @toast-text-color;
  background: rgba(0, 0, 0, 60%);
  text-align: center;
  padding: @spacer-5;
  z-index: @toast-z-index;

  &:not(&--text)&--column {
    border-radius: @border-radius * 2;
  }

  .@{prefix}-icon {
    color: inherit;
    font-size: 48px;
  }

  &__text {
    font-size: @toast-font-size-base;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 22px;
    margin-top: @spacer-3;
    min-width: 82px;
  }

  &--text {
    width: fit-content;
    padding-top: @spacer;
    padding-bottom: @spacer;

    .@{prefix}-toast__text {
      margin-top: 0;
      min-width: auto;
    }
  }

  /** 有无icon判断 */
  &--icononly {
    padding-top: @spacer-3;
    padding-bottom: @spacer-3;
    min-width: 88px;
    min-height: 88px !important; // stylelint-disable-line
    flex-direction: initial;
  }

  &--middle {
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
  }

  &--top {
    left: 50%;
    top: @spacer-3;
    transform: translateX(-50%);
  }

  &--bottom {
    left: 50%;
    bottom: @spacer-3;
    transform: translateX(-50%);
  }

  &--row {
    flex-direction: row;
    padding: 14px 24px;

    .@{prefix}-icon {
      color: inherit;
      font-size: 24px;
    }

    .@{prefix}-toast__text {
      margin-top: 0;
      margin-left: @spacer-2;
      min-width: auto;
      line-height: 24px;
    }
  }
}
